home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
DATATURE
/
PBASE.LZH
/
WINE.PRG
< prev
Wrap
Text File
|
1985-10-04
|
2KB
|
83 lines
* WINE.PRG (10-04.a)
* simple SQL commands & a wine table
SWITCH DEFAULT
SWITCH TALK OFF
RESET DATABASE
CLEAR SCREEN
DOMENU
MENUTITLE '[ Run SQL with... ]'
MENUOPTION 'Command echo'
MENUOPTION 'Command single-step'
MENUOPTION 'Do NOT run test'
MENUCHOICE choice
ENDMENU
DOCASE
CASE choice=1
ASSIGN 'ECHO' TO _switch
CASE choice=2
ASSIGN 'STEP' to _switch
CASE choice=3
SWITCH DEFAULT
RETURN
OTHERWISE
SWITCH DEFAULT
RETURN
ENDCASE
SWITCH &_switch ON
CREATE DATABASE wine
CREATE CURSOR 1 FOR wine
USE CURSOR 1
CLEAR SCREEN
CREATE TABLE cellar;
(bin NUMBER,wine CHAR(15),producer CHAR(15),year NUMBER,bottles NUMBER,comments CHAR(25))
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(2,'Chardonnay','Buena Vista',79,1,NULL)
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(3,'Chardonnay','Louis Martini',81,5,NULL)
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(6,'Chardonnay','Chappellet',80,4,'Thanksgiving')
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(11,'Riesling','Jekel',80,6,NULL)
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(12,'Riesling','Buena Vista',77,1,'Late harvest')
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(16,'Riesling','Sattui',79,1,'Very dry')
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(43,'Cab.Sauvignon','Robt.Mondavi',77,12,NULL)
INSERT INTO cellar;
(bin,wine,producer,year,bottles,comments);
VALUES(64,'Zinfandel','Mirassou',77,2,'Anniversary')
PAUSE
CLEAR SCREEN
SELECT bin,wine,producer,year,bottles FROM cellar;
ORDER BY producer,year
SHOW
PAUSE
CLEAR SCREEN
SELECT bin,wine,producer,year,bottles FROM cellar;
WHERE wine='Chardonnay' ORDER BY year
SHOW
UPDATE cellar SET bottles=4 WHERE bin=3
SELECT bin,wine,producer,year,bottles FROM cellar;
WHERE wine='Chardonnay' ORDER BY year
SHOW
PAUSE
CLEAR SCREEN
DELETE FROM cellar WHERE bin=2
SELECT bin,wine,producer,year,bottles FROM cellar;
WHERE wine='Chardonnay' ORDER BY year
SHOW
PAUSE
CLEAR SCREEN
DROP CURSOR 1
SWITCH DEFAULT